﻿Imports DTO
Imports BUS
Public Class frmCHITIETPHIEUNHAP

    Private IsInitializing As Boolean

    Private Sub btt_thoat_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Me.Close()
    End Sub
    Dim drw As DataRow
    Dim dt As New PhieuNhapBUS
    Private Sub frmCHITIETPHIEUNHAP_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        LoadDsPN()

        Dim i As Integer
        For i = 1988 To Year(Now())

            cbo_theonam.Items.Add(i)

        Next
        rad_theongay.Checked = False
        dtp_theongay.Enabled = False
        rad_theothang.Checked = False
        cbo_theothang.Enabled = False
        cbo_theothang.SelectedIndex = 0
        rad_theoqui.Checked = False
        cbo_theoqui.SelectedIndex = 0
        cbo_theoqui.Enabled = False
        rad_theonam.Checked = False
        cbo_theonam.Enabled = False
        cbo_theonam.SelectedIndex = 0
    End Sub
    Dim pnbus As New PhieuNhapBUS
    Private Sub LoadDsPN()
        Dim dt As DataTable = New DataTable
        dt = pnbus.LayTTPN()
        dgv_chitiet.DataSource = dt
    End Sub

    

    Private Sub btn_xem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_xem.Click
        If rad_theongay.Checked = True Then
            'dtp_theongay.Value = 
        End If
    End Sub

    Private Sub rad_theongay_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rad_theongay.Click
        Label1.Visible = False
        rad_theongay.Checked = True
        dtp_theongay.Enabled = True
        rad_theothang.Checked = False
        cbo_theothang.Enabled = False
        rad_theoqui.Checked = False
        cbo_theoqui.Enabled = False
        rad_theonam.Checked = False
        cbo_theonam.Enabled = False
        dgv_chitiet.DataSource = ""
    End Sub

    Private Sub rad_theothang_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rad_theothang.Click
        rad_theongay.Checked = False
        dtp_theongay.Enabled = False
        rad_theothang.Checked = True
        cbo_theothang.Enabled = True
        rad_theoqui.Checked = False
        cbo_theoqui.Enabled = False
        rad_theonam.Checked = False
        cbo_theonam.Enabled = False
        dgv_chitiet.DataSource = ""
    End Sub

    Private Sub rad_theoqui_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rad_theoqui.Click
        rad_theongay.Checked = False
        dtp_theongay.Enabled = False
        rad_theothang.Checked = False
        cbo_theothang.Enabled = False
        rad_theoqui.Checked = True
        cbo_theoqui.Enabled = True
        rad_theonam.Checked = False
        cbo_theonam.Enabled = False
        dgv_chitiet.DataSource = ""
    End Sub

    Private Sub rad_theonam_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rad_theonam.Click
        rad_theongay.Checked = False
        dtp_theongay.Enabled = False
        rad_theothang.Checked = False
        cbo_theothang.Enabled = False
        rad_theoqui.Checked = False
        cbo_theoqui.Enabled = False
        rad_theonam.Checked = True
        cbo_theonam.Enabled = True
        dgv_chitiet.DataSource = ""
    End Sub

    Private Sub btn_thoat_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_thoat.Click
        Me.Close()
    End Sub
End Class